home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 1999 September (IDG) / Sep99.iso / Shareware World / Utilities / Text Processing / Alpha / Tcl / Modes / latex Mode / latexKeys.tcl < prev    next >
Encoding:
Text File  |  1999-02-26  |  4.8 KB  |  129 lines  |  [TEXT/ALFA]

  1. #############################################################################
  2. #############################################################################
  3. #
  4. # latexKeys.tcl (called from latex.tcl)
  5. #
  6. # Special LaTeX key bindings (see latexMenu.tcl for additional bindings)
  7. #
  8. # abbreviations:  <o> = option, <z> = control, <s> = shift, <c> = command
  9. #
  10. #############################################################################
  11. #
  12. # Author:  Tom Scavo <trscavo@syr.edu>
  13. #
  14. #############################################################################
  15. proc latexKeys.tcl {} {}
  16.  
  17. ##############################################################################
  18.  
  19. # Initial binding of LaTeX command keys.
  20. proc bindLaTeXKeys {} {
  21.     
  22.     proc bindKeypadKeys {} {
  23.     global TeXmodeVars
  24.     # Completely take over the keypad:
  25.     set mods {<> <c> <o> <z> <s> <co> <cz> <cs> <oz> <os> <zs> \
  26.       <coz> <cos> <ozs> <cozs>}
  27.     if {$TeXmodeVars(takeOverNumericKeypad)} {
  28.         foreach mod $mods {
  29.         Bind Kpad0 $mod dummyTeX "TeX"
  30.         Bind Kpad1 $mod dummyTeX "TeX"
  31.         Bind Kpad2 $mod dummyTeX "TeX"
  32.         Bind Kpad3 $mod dummyTeX "TeX"
  33.         Bind Kpad4 $mod dummyTeX "TeX"
  34.         Bind Kpad5 $mod dummyTeX "TeX"
  35.         Bind Kpad6 $mod dummyTeX "TeX"
  36.         Bind Kpad7 $mod dummyTeX "TeX"
  37.         Bind Kpad8 $mod dummyTeX "TeX"
  38.         Bind Kpad9 $mod dummyTeX "TeX"
  39.         Bind Kpad= $mod dummyTeX "TeX"
  40.         Bind Kpad/ $mod dummyTeX "TeX"
  41.         Bind Kpad* $mod dummyTeX "TeX"
  42.         Bind Kpad- $mod dummyTeX "TeX"
  43.         Bind Kpad+ $mod dummyTeX "TeX"
  44.         Bind Enter $mod dummyTeX "TeX"
  45.         Bind Kpad. $mod dummyTeX "TeX"
  46.         }
  47.     }
  48.     
  49.     Bind Kpad8 prevSubsection "TeX"
  50.     Bind Kpad2 nextSubsection "TeX"
  51.     Bind Kpad8 <s> prevSubsectionSelect "TeX"
  52.     Bind Kpad2 <s> nextSubsectionSelect "TeX"
  53.     Bind Kpad8 <c> prevSection "TeX"
  54.     Bind Kpad2 <c> nextSection "TeX"
  55.     Bind Kpad8 <sc> prevSectionSelect "TeX"
  56.     Bind Kpad2 <sc> nextSectionSelect "TeX"
  57.     Bind Kpad4 prevCommand "TeX"
  58.     Bind Kpad6 nextCommand "TeX"
  59.     Bind Kpad4 <s> prevCommandSelect "TeX"
  60.     Bind Kpad6 <s> nextCommandSelect "TeX"
  61.     Bind Kpad4 <so> prevCommandSelectWithArgs "TeX"
  62.     Bind Kpad6 <so> nextCommandSelectWithArgs "TeX"
  63.     Bind Kpad4 <c> prevEnvironment "TeX"
  64.     Bind Kpad6 <c> nextEnvironment "TeX"
  65.     Bind Kpad4 <sc> prevEnvironmentSelect "TeX"
  66.     Bind Kpad6 <sc> nextEnvironmentSelect "TeX"
  67.     }
  68.     
  69.     proc bindGreekKeys {func} {
  70.     $func    'm'    <z>    prefixChar "TeX"
  71.     $func    'a'    <M>    [list TeX::mp::greek "" alpha] "TeX"
  72.     $func    'b'    <M>    [list TeX::mp::greek "" beta]    "TeX"
  73.     $func    'c'    <M>    [list TeX::mp::greek "" chi]    "TeX"
  74.     $func    'd'    <M>    [list TeX::mp::greek "" delta]    "TeX"
  75.     $func    'd'    <sM>    [list TeX::mp::greek "" Delta]    "TeX"
  76.     $func    'e'    <M>    [list TeX::mp::greek "" epsilon]    "TeX"
  77.     $func    'e'    <zM>    [list TeX::mp::greek "" varepsilon]    "TeX"
  78.     $func    'f'    <M>    [list TeX::mp::greek "" phi]    "TeX"
  79.     $func    'f'    <sM>    [list TeX::mp::greek "" Phi]    "TeX"
  80.     $func    'f'    <zM>    [list TeX::mp::greek "" varphi]    "TeX"
  81.     $func    'g'    <M>    [list TeX::mp::greek "" gamma]    "TeX"
  82.     $func    'g'    <sM>    [list TeX::mp::greek "" Gamma]    "TeX"
  83.     $func    'h'    <M>    [list TeX::mp::greek "" eta]    "TeX"
  84.     $func    'i'    <M>    [list TeX::mp::greek "" iota]    "TeX"
  85.     $func    'k'    <M>    [list TeX::mp::greek "" kappa]    "TeX"
  86.     $func    'l'    <M>    [list TeX::mp::greek "" lambda]    "TeX"
  87.     $func    'l'    <sM>    [list TeX::mp::greek "" Lambda]    "TeX"
  88.     $func    'm'    <M>    [list TeX::mp::greek "" mu]    "TeX"
  89.     $func    'n'    <M>    [list TeX::mp::greek "" nu]    "TeX"
  90.     $func    'o'    <M>    [list TeX::mp::greek "" omicron]    "TeX"
  91.     $func    'p'    <M>    [list TeX::mp::greek "" pi]    "TeX"
  92.     $func    'p'    <sM>    [list TeX::mp::greek "" Pi]    "TeX"
  93.     $func    'p'    <zM>    [list TeX::mp::greek "" varpi]    "TeX"
  94.     $func    'q'    <M>    [list TeX::mp::greek "" theta]    "TeX"
  95.     $func    'q'    <sM>    [list TeX::mp::greek "" Theta]    "TeX"
  96.     $func    'q'    <zM>    [list TeX::mp::greek "" vartheta]    "TeX"
  97.     $func    'r'    <M>    [list TeX::mp::greek "" rho]    "TeX"
  98.     $func    'r'    <zM>    [list TeX::mp::greek "" varrho]    "TeX"
  99.     $func    's'    <M>    [list TeX::mp::greek "" sigma]    "TeX"
  100.     $func    's'    <sM>    [list TeX::mp::greek "" Sigma]    "TeX"
  101.     $func    's'    <zM>    [list TeX::mp::greek "" varsigma]    "TeX"
  102.     $func    't'    <M>    [list TeX::mp::greek "" tau]    "TeX"
  103.     $func    'u'    <M>    [list TeX::mp::greek "" upsilon]    "TeX"
  104.     $func    'u'    <sM>    [list TeX::mp::greek "" Upsilon]    "TeX"
  105.     $func    'v'    <M>    [list TeX::mp::greek "" nabla]    "TeX"
  106.     $func    'w'    <M>    [list TeX::mp::greek "" omega]    "TeX"
  107.     $func    'w'    <sM>    [list TeX::mp::greek "" Omega]    "TeX"
  108.     $func    'x'    <M>    [list TeX::mp::greek "" xi]    "TeX"
  109.     $func    'x'    <sM>    [list TeX::mp::greek "" Xi]    "TeX"
  110.     $func    'y'    <M>    [list TeX::mp::greek "" psi]    "TeX"
  111.     $func    'y'    <sM>    [list TeX::mp::greek "" Psi]    "TeX"
  112.     $func    'z'    <M>    [list TeX::mp::greek "" zeta]    "TeX"
  113.     }
  114.  
  115.     bindKeypadKeys
  116.     bindGreekKeys "Bind"
  117.     
  118.     # Bind double quote:
  119.     ascii 0x22 <s> smartDQuote TeX
  120.     # Bind single quote:
  121.     ascii 0x27 smartQuote TeX
  122.     # Bind period:
  123.     ascii 0x2e smartDots "TeX"
  124.     # Bind delete key: (use ascii to avoid dead-key problem)
  125.     #Bind 0x33 escapeSmartStuff "TeX"
  126.     ascii 0x08 escapeSmartStuff "TeX"
  127.  
  128. }
  129.